home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / mx / controls / treeClasses / HierarchicalCollectionView.as < prev    next >
Text File  |  2009-12-16  |  24KB  |  672 lines

  1. package mx.controls.treeClasses
  2. {
  3.    import flash.events.EventDispatcher;
  4.    import flash.utils.Dictionary;
  5.    import mx.collections.ICollectionView;
  6.    import mx.collections.IViewCursor;
  7.    import mx.collections.Sort;
  8.    import mx.collections.XMLListAdapter;
  9.    import mx.collections.XMLListCollection;
  10.    import mx.collections.errors.ItemPendingError;
  11.    import mx.core.EventPriority;
  12.    import mx.core.mx_internal;
  13.    import mx.events.CollectionEvent;
  14.    import mx.events.CollectionEventKind;
  15.    import mx.events.PropertyChangeEvent;
  16.    import mx.utils.IXMLNotifiable;
  17.    import mx.utils.XMLNotifier;
  18.    
  19.    use namespace mx_internal;
  20.    
  21.    public class HierarchicalCollectionView extends EventDispatcher implements ICollectionView, IXMLNotifiable
  22.    {
  23.       
  24.       mx_internal static const VERSION:String = "3.5.0.12683";
  25.        
  26.       
  27.       private var itemToUID:Function;
  28.       
  29.       public var openNodes:Object;
  30.       
  31.       private var dataDescriptor:ITreeDataDescriptor;
  32.       
  33.       private var currentLength:int;
  34.       
  35.       private var parentNode:XML;
  36.       
  37.       public var parentMap:Object;
  38.       
  39.       private var cursor:HierarchicalViewCursor;
  40.       
  41.       private var childrenMap:Dictionary;
  42.       
  43.       private var treeData:ICollectionView;
  44.       
  45.       public function HierarchicalCollectionView(param1:ICollectionView, param2:ITreeDataDescriptor, param3:Function, param4:Object = null)
  46.       {
  47.          super();
  48.          parentMap = {};
  49.          childrenMap = new Dictionary(true);
  50.          treeData = param1;
  51.          treeData.addEventListener(CollectionEvent.COLLECTION_CHANGE,collectionChangeHandler,false,EventPriority.DEFAULT_HANDLER,true);
  52.          addEventListener(CollectionEvent.COLLECTION_CHANGE,expandEventHandler,false,0,true);
  53.          dataDescriptor = param2;
  54.          this.itemToUID = param3;
  55.          openNodes = param4;
  56.          currentLength = calculateLength();
  57.       }
  58.       
  59.       public function nestedCollectionChangeHandler(param1:CollectionEvent) : void
  60.       {
  61.          var _loc2_:int = 0;
  62.          var _loc3_:int = 0;
  63.          var _loc4_:int = 0;
  64.          var _loc5_:String = null;
  65.          var _loc6_:Object = null;
  66.          var _loc7_:Object = null;
  67.          var _loc8_:Array = null;
  68.          var _loc9_:CollectionEvent = null;
  69.          var _loc10_:CollectionEvent = null;
  70.          var _loc11_:int = 0;
  71.          if(param1 is CollectionEvent)
  72.          {
  73.             if((_loc10_ = CollectionEvent(param1)).kind == CollectionEventKind.mx_internal::EXPAND)
  74.             {
  75.                param1.stopImmediatePropagation();
  76.             }
  77.             else if(_loc10_.kind == CollectionEventKind.ADD)
  78.             {
  79.                updateLength();
  80.                _loc3_ = _loc10_.items.length;
  81.                _loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,_loc10_.kind);
  82.                _loc2_ = 0;
  83.                while(_loc2_ < _loc3_)
  84.                {
  85.                   if((_loc7_ = _loc10_.items[_loc2_]) is XML)
  86.                   {
  87.                      startTrackUpdates(_loc7_);
  88.                   }
  89.                   if((_loc6_ = getParentItem(_loc7_)) != null)
  90.                   {
  91.                      getVisibleNodes(_loc7_,_loc6_,_loc9_.items);
  92.                   }
  93.                   _loc2_++;
  94.                }
  95.                _loc9_.location = getVisibleLocationInSubCollection(_loc6_,_loc10_.location);
  96.                dispatchEvent(_loc9_);
  97.             }
  98.             else if(_loc10_.kind == CollectionEventKind.REMOVE)
  99.             {
  100.                _loc3_ = _loc10_.items.length;
  101.                _loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,_loc10_.kind);
  102.                _loc2_ = 0;
  103.                while(_loc2_ < _loc3_)
  104.                {
  105.                   if((_loc7_ = _loc10_.items[_loc2_]) is XML)
  106.                   {
  107.                      stopTrackUpdates(_loc7_);
  108.                   }
  109.                   if((_loc6_ = getParentItem(_loc7_)) != null)
  110.                   {
  111.                      getVisibleNodes(_loc7_,_loc6_,_loc9_.items);
  112.                   }
  113.                   _loc2_++;
  114.                }
  115.                _loc9_.location = getVisibleLocationInSubCollection(_loc6_,_loc10_.location);
  116.                currentLength -= _loc9_.items.length;
  117.                dispatchEvent(_loc9_);
  118.             }
  119.             else if(_loc10_.kind == CollectionEventKind.UPDATE)
  120.             {
  121.                dispatchEvent(param1);
  122.             }
  123.             else if(_loc10_.kind == CollectionEventKind.REPLACE)
  124.             {
  125.                _loc3_ = _loc10_.items.length;
  126.                _loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,CollectionEventKind.REMOVE);
  127.                _loc2_ = 0;
  128.                while(_loc2_ < _loc3_)
  129.                {
  130.                   _loc7_ = _loc10_.items[_loc2_].oldValue;
  131.                   if((_loc6_ = getParentItem(_loc7_)) != null)
  132.                   {
  133.                      getVisibleNodes(_loc7_,_loc6_,_loc9_.items);
  134.                   }
  135.                   _loc2_++;
  136.                }
  137.                _loc11_ = 0;
  138.                _loc2_ = 0;
  139.                while(_loc2_ < _loc3_)
  140.                {
  141.                   if((_loc7_ = _loc10_.items[_loc2_].oldValue) is XML)
  142.                   {
  143.                      stopTrackUpdates(_loc7_);
  144.                   }
  145.                   while(_loc9_.items[_loc11_] != _loc7_)
  146.                   {
  147.                      _loc11_++;
  148.                   }
  149.                   _loc9_.items.splice(_loc11_,1);
  150.                   _loc2_++;
  151.                }
  152.                if(_loc9_.items.length)
  153.                {
  154.                   currentLength -= _loc9_.items.length;
  155.                   dispatchEvent(_loc9_);
  156.                }
  157.                dispatchEvent(param1);
  158.             }
  159.             else if(_loc10_.kind == CollectionEventKind.RESET)
  160.             {
  161.                updateLength();
  162.                _loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,CollectionEventKind.REFRESH);
  163.                dispatchEvent(_loc9_);
  164.             }
  165.          }
  166.       }
  167.       
  168.       private function getVisibleLocationInSubCollection(param1:Object, param2:int) : int
  169.       {
  170.          var _loc5_:ICollectionView = null;
  171.          var _loc6_:IViewCursor = null;
  172.          var _loc3_:int = param2;
  173.          var _loc4_:Object = param1;
  174.          param1 = getParentItem(param1);
  175.          while(param1 != null)
  176.          {
  177.             _loc6_ = (_loc5_ = childrenMap[param1]).createCursor();
  178.             while(!_loc6_.afterLast)
  179.             {
  180.                if(_loc6_.current == _loc4_)
  181.                {
  182.                   _loc3_++;
  183.                   break;
  184.                }
  185.                _loc3_ += calculateLength(_loc6_.current,param1) + 1;
  186.                _loc6_.moveNext();
  187.             }
  188.             _loc4_ = param1;
  189.             param1 = getParentItem(param1);
  190.          }
  191.          _loc6_ = treeData.createCursor();
  192.          while(!_loc6_.afterLast)
  193.          {
  194.             if(_loc6_.current == _loc4_)
  195.             {
  196.                _loc3_++;
  197.                break;
  198.             }
  199.             _loc3_ += calculateLength(_loc6_.current,param1) + 1;
  200.             _loc6_.moveNext();
  201.          }
  202.          return _loc3_;
  203.       }
  204.       
  205.       public function expandEventHandler(param1:CollectionEvent) : void
  206.       {
  207.          var _loc2_:CollectionEvent = null;
  208.          if(param1 is CollectionEvent)
  209.          {
  210.             _loc2_ = CollectionEvent(param1);
  211.             if(_loc2_.kind == CollectionEventKind.mx_internal::EXPAND)
  212.             {
  213.                param1.stopImmediatePropagation();
  214.                updateLength();
  215.             }
  216.          }
  217.       }
  218.       
  219.       private function updateLength(param1:Object = null, param2:Object = null) : void
  220.       {
  221.          currentLength = calculateLength();
  222.       }
  223.       
  224.       private function startTrackUpdates(param1:Object) : void
  225.       {
  226.          XMLNotifier.getInstance().watchXML(param1,this);
  227.       }
  228.       
  229.       private function getVisibleLocation(param1:int) : int
  230.       {
  231.          var _loc2_:int = 0;
  232.          var _loc3_:IViewCursor = treeData.createCursor();
  233.          var _loc4_:int = 0;
  234.          while(_loc4_ < param1 && !_loc3_.afterLast)
  235.          {
  236.             _loc2_ += calculateLength(_loc3_.current,null) + 1;
  237.             _loc3_.moveNext();
  238.             _loc4_++;
  239.          }
  240.          return _loc2_;
  241.       }
  242.       
  243.       public function describeData() : Object
  244.       {
  245.          return null;
  246.       }
  247.       
  248.       public function get sort() : Sort
  249.       {
  250.          return null;
  251.       }
  252.       
  253.       public function contains(param1:Object) : Boolean
  254.       {
  255.          var _loc2_:IViewCursor = createCursor();
  256.          var _loc3_:Boolean = false;
  257.          while(!_loc3_)
  258.          {
  259.             if(_loc2_.current == param1)
  260.             {
  261.                return true;
  262.             }
  263.             _loc3_ = _loc2_.moveNext();
  264.          }
  265.          return false;
  266.       }
  267.       
  268.       private function stopTrackUpdates(param1:Object) : void
  269.       {
  270.          XMLNotifier.getInstance().unwatchXML(param1,this);
  271.       }
  272.       
  273.       public function xmlNotification(param1:Object, param2:String, param3:Object, param4:Object, param5:Object) : void
  274.       {
  275.          var _loc6_:String = null;
  276.          var _loc7_:Object = null;
  277.          var _loc8_:Object = null;
  278.          var _loc9_:XMLListCollection = null;
  279.          var _loc10_:int = 0;
  280.          var _loc11_:CollectionEvent = null;
  281.          var _loc12_:XMLListAdapter = null;
  282.          var _loc13_:* = undefined;
  283.          var _loc14_:* = undefined;
  284.          var _loc15_:XMLList = null;
  285.          var _loc16_:XMLListCollection = null;
  286.          var _loc17_:int = 0;
  287.          var _loc18_:int = 0;
  288.          if(param1 === param3)
  289.          {
  290.             switch(param2)
  291.             {
  292.                case "nodeAdded":
  293.                   for(_loc13_ in childrenMap)
  294.                   {
  295.                      if(_loc13_ === param1)
  296.                      {
  297.                         _loc12_ = childrenMap[_loc13_].list as XMLListAdapter;
  298.                         break;
  299.                      }
  300.                   }
  301.                   if(!_loc12_ && param3 is XML && XML(param3).children().length() == 1)
  302.                   {
  303.                      _loc12_ = (getChildren(param3) as XMLListCollection).list as XMLListAdapter;
  304.                   }
  305.                   if(_loc12_ && !_loc12_.busy())
  306.                   {
  307.                      if(childrenMap[_loc13_] === treeData)
  308.                      {
  309.                         _loc9_ = treeData as XMLListCollection;
  310.                         if(parentNode)
  311.                         {
  312.                            _loc9_.mx_internal::dispatchResetEvent = false;
  313.                            _loc9_.source = parentNode.*;
  314.                         }
  315.                      }
  316.                      else
  317.                      {
  318.                         _loc9_ = getChildren(_loc13_) as XMLListCollection;
  319.                      }
  320.                      if(_loc9_)
  321.                      {
  322.                         _loc10_ = param4.childIndex();
  323.                         (_loc11_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)).kind = CollectionEventKind.ADD;
  324.                         _loc11_.location = _loc10_;
  325.                         _loc11_.items = [param4];
  326.                         _loc9_.dispatchEvent(_loc11_);
  327.                      }
  328.                   }
  329.                   break;
  330.                case "nodeRemoved":
  331.                   for(_loc14_ in childrenMap)
  332.                   {
  333.                      if(_loc14_ === param1)
  334.                      {
  335.                         if((_loc12_ = (_loc9_ = childrenMap[_loc14_]).list as XMLListAdapter) && !_loc12_.busy())
  336.                         {
  337.                            _loc15_ = _loc9_.source as XMLList;
  338.                            if(childrenMap[_loc14_] === treeData)
  339.                            {
  340.                               _loc9_ = treeData as XMLListCollection;
  341.                               if(parentNode)
  342.                               {
  343.                                  _loc9_.mx_internal::dispatchResetEvent = false;
  344.                                  _loc9_.source = parentNode.*;
  345.                               }
  346.                            }
  347.                            else
  348.                            {
  349.                               _loc16_ = _loc9_;
  350.                               if(!(_loc9_ = getChildren(_loc14_) as XMLListCollection))
  351.                               {
  352.                                  _loc16_.addEventListener(CollectionEvent.COLLECTION_CHANGE,nestedCollectionChangeHandler,false,0,true);
  353.                                  (_loc11_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)).kind = CollectionEventKind.REMOVE;
  354.                                  _loc11_.location = 0;
  355.                                  _loc11_.items = [param4];
  356.                                  _loc16_.dispatchEvent(_loc11_);
  357.                                  _loc16_.removeEventListener(CollectionEvent.COLLECTION_CHANGE,nestedCollectionChangeHandler);
  358.                               }
  359.                            }
  360.                            if(_loc9_)
  361.                            {
  362.                               _loc17_ = _loc15_.length();
  363.                               _loc18_ = 0;
  364.                               while(_loc18_ < _loc17_)
  365.                               {
  366.                                  if(_loc15_[_loc18_] === param4)
  367.                                  {
  368.                                     (_loc11_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)).kind = CollectionEventKind.REMOVE;
  369.                                     _loc11_.location = _loc10_;
  370.                                     _loc11_.items = [param4];
  371.                                     _loc9_.dispatchEvent(_loc11_);
  372.                                     break;
  373.                                  }
  374.                                  _loc18_++;
  375.                               }
  376.                            }
  377.                         }
  378.                         break;
  379.                      }
  380.                   }
  381.             }
  382.          }
  383.       }
  384.       
  385.       public function itemUpdated(param1:Object, param2:Object = null, param3:Object = null, param4:Object = null) : void
  386.       {
  387.          var _loc5_:CollectionEvent;
  388.          (_loc5_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)).kind = CollectionEventKind.UPDATE;
  389.          var _loc6_:PropertyChangeEvent;
  390.          (_loc6_ = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE)).property = param2;
  391.          _loc6_.oldValue = param3;
  392.          _loc6_.newValue = param4;
  393.          _loc5_.items.push(_loc6_);
  394.          dispatchEvent(_loc5_);
  395.       }
  396.       
  397.       public function enableAutoUpdate() : void
  398.       {
  399.       }
  400.       
  401.       public function set sort(param1:Sort) : void
  402.       {
  403.       }
  404.       
  405.       public function getParentItem(param1:Object) : *
  406.       {
  407.          var _loc2_:String = itemToUID(param1);
  408.          if(parentMap.hasOwnProperty(_loc2_))
  409.          {
  410.             return parentMap[_loc2_];
  411.          }
  412.          return undefined;
  413.       }
  414.       
  415.       private function getVisibleNodes(param1:Object, param2:Object, param3:Array) : void
  416.       {
  417.          var _loc4_:ICollectionView = null;
  418.          var _loc6_:int = 0;
  419.          var _loc7_:int = 0;
  420.          param3.push(param1);
  421.          var _loc5_:String = itemToUID(param1);
  422.          parentMap[_loc5_] = param2;
  423.          if(openNodes[_loc5_] && dataDescriptor.isBranch(param1,treeData) && dataDescriptor.hasChildren(param1,treeData))
  424.          {
  425.             if((_loc4_ = getChildren(param1)) != null)
  426.             {
  427.                _loc6_ = _loc4_.length;
  428.                _loc7_ = 0;
  429.                while(_loc7_ < _loc6_)
  430.                {
  431.                   getVisibleNodes(_loc4_[_loc7_],param1,param3);
  432.                   _loc7_++;
  433.                }
  434.             }
  435.          }
  436.       }
  437.       
  438.       public function refresh() : Boolean
  439.       {
  440.          var _loc1_:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
  441.          _loc1_.kind = CollectionEventKind.REFRESH;
  442.          dispatchEvent(_loc1_);
  443.          return true;
  444.       }
  445.       
  446.       public function get length() : int
  447.       {
  448.          return currentLength;
  449.       }
  450.       
  451.       public function set filterFunction(param1:Function) : void
  452.       {
  453.       }
  454.       
  455.       public function calculateLength(param1:Object = null, param2:Object = null) : int
  456.       {
  457.          var length:int = 0;
  458.          var childNodes:ICollectionView = null;
  459.          var modelOffset:int = 0;
  460.          var modelCursor:IViewCursor = null;
  461.          var parNode:* = undefined;
  462.          var uid:String = null;
  463.          var numChildren:int = 0;
  464.          var i:int = 0;
  465.          var node:Object = param1;
  466.          var parent:Object = param2;
  467.          length = 0;
  468.          var firstNode:Boolean = true;
  469.          if(node == null)
  470.          {
  471.             modelOffset = 0;
  472.             modelCursor = treeData.createCursor();
  473.             if(modelCursor.beforeFirst)
  474.             {
  475.                return treeData.length;
  476.             }
  477.             while(!modelCursor.afterLast)
  478.             {
  479.                node = modelCursor.current;
  480.                if(node is XML)
  481.                {
  482.                   if(firstNode)
  483.                   {
  484.                      firstNode = false;
  485.                      parNode = node.parent();
  486.                      if(parNode)
  487.                      {
  488.                         startTrackUpdates(parNode);
  489.                         childrenMap[parNode] = treeData;
  490.                         parentNode = parNode;
  491.                      }
  492.                   }
  493.                   startTrackUpdates(node);
  494.                }
  495.                if(node === null)
  496.                {
  497.                   length += 1;
  498.                }
  499.                else
  500.                {
  501.                   length += calculateLength(node,null) + 1;
  502.                }
  503.                modelOffset++;
  504.                try
  505.                {
  506.                   modelCursor.moveNext();
  507.                }
  508.                catch(e:ItemPendingError)
  509.                {
  510.                   length += treeData.length - modelOffset;
  511.                   return length;
  512.                }
  513.             }
  514.          }
  515.          else
  516.          {
  517.             uid = itemToUID(node);
  518.             parentMap[uid] = parent;
  519.             if(node != null && openNodes[uid] && dataDescriptor.isBranch(node,treeData) && dataDescriptor.hasChildren(node,treeData))
  520.             {
  521.                childNodes = getChildren(node);
  522.                if(childNodes != null)
  523.                {
  524.                   numChildren = childNodes.length;
  525.                   i = 0;
  526.                   while(i < numChildren)
  527.                   {
  528.                      if(node is XML)
  529.                      {
  530.                         startTrackUpdates(childNodes[i]);
  531.                      }
  532.                      length += calculateLength(childNodes[i],node) + 1;
  533.                      i++;
  534.                   }
  535.                }
  536.             }
  537.          }
  538.          return length;
  539.       }
  540.       
  541.       public function disableAutoUpdate() : void
  542.       {
  543.       }
  544.       
  545.       public function createCursor() : IViewCursor
  546.       {
  547.          return new HierarchicalViewCursor(this,treeData,dataDescriptor,itemToUID,openNodes);
  548.       }
  549.       
  550.       private function getChildren(param1:Object) : ICollectionView
  551.       {
  552.          var _loc2_:ICollectionView = dataDescriptor.getChildren(param1,treeData);
  553.          var _loc3_:ICollectionView = childrenMap[param1];
  554.          if(_loc3_ != _loc2_)
  555.          {
  556.             if(_loc3_ != null)
  557.             {
  558.                _loc3_.removeEventListener(CollectionEvent.COLLECTION_CHANGE,nestedCollectionChangeHandler);
  559.             }
  560.             if(_loc2_)
  561.             {
  562.                _loc2_.addEventListener(CollectionEvent.COLLECTION_CHANGE,nestedCollectionChangeHandler,false,0,true);
  563.                childrenMap[param1] = _loc2_;
  564.             }
  565.             else
  566.             {
  567.                delete childrenMap[param1];
  568.             }
  569.          }
  570.          return _loc2_;
  571.       }
  572.       
  573.       public function get filterFunction() : Function
  574.       {
  575.          return null;
  576.       }
  577.       
  578.       public function collectionChangeHandler(param1:CollectionEvent) : void
  579.       {
  580.          var _loc2_:int = 0;
  581.          var _loc3_:int = 0;
  582.          var _loc4_:int = 0;
  583.          var _loc5_:String = null;
  584.          var _loc6_:Object = null;
  585.          var _loc7_:Object = null;
  586.          var _loc8_:Array = null;
  587.          var _loc9_:CollectionEvent = null;
  588.          var _loc10_:CollectionEvent = null;
  589.          var _loc11_:int = 0;
  590.          if(param1 is CollectionEvent)
  591.          {
  592.             if((_loc10_ = CollectionEvent(param1)).kind == CollectionEventKind.RESET)
  593.             {
  594.                updateLength();
  595.                dispatchEvent(param1);
  596.             }
  597.             else if(_loc10_.kind == CollectionEventKind.ADD)
  598.             {
  599.                _loc3_ = _loc10_.items.length;
  600.                (_loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,_loc10_.kind)).location = getVisibleLocation(_loc10_.location);
  601.                _loc2_ = 0;
  602.                while(_loc2_ < _loc3_)
  603.                {
  604.                   if((_loc7_ = _loc10_.items[_loc2_]) is XML)
  605.                   {
  606.                      startTrackUpdates(_loc7_);
  607.                   }
  608.                   getVisibleNodes(_loc7_,null,_loc9_.items);
  609.                   _loc2_++;
  610.                }
  611.                currentLength += _loc9_.items.length;
  612.                dispatchEvent(_loc9_);
  613.             }
  614.             else if(_loc10_.kind == CollectionEventKind.REMOVE)
  615.             {
  616.                _loc3_ = _loc10_.items.length;
  617.                (_loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,_loc10_.kind)).location = getVisibleLocation(_loc10_.location);
  618.                _loc2_ = 0;
  619.                while(_loc2_ < _loc3_)
  620.                {
  621.                   if((_loc7_ = _loc10_.items[_loc2_]) is XML)
  622.                   {
  623.                      stopTrackUpdates(_loc7_);
  624.                   }
  625.                   getVisibleNodes(_loc7_,null,_loc9_.items);
  626.                   _loc2_++;
  627.                }
  628.                currentLength -= _loc9_.items.length;
  629.                dispatchEvent(_loc9_);
  630.             }
  631.             else if(_loc10_.kind == CollectionEventKind.UPDATE)
  632.             {
  633.                dispatchEvent(param1);
  634.             }
  635.             else if(_loc10_.kind == CollectionEventKind.REPLACE)
  636.             {
  637.                _loc3_ = _loc10_.items.length;
  638.                _loc9_ = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,false,true,CollectionEventKind.REMOVE);
  639.                _loc2_ = 0;
  640.                while(_loc2_ < _loc3_)
  641.                {
  642.                   if((_loc7_ = _loc10_.items[_loc2_].oldValue) is XML)
  643.                   {
  644.                      stopTrackUpdates(_loc7_);
  645.                   }
  646.                   getVisibleNodes(_loc7_,null,_loc9_.items);
  647.                   _loc2_++;
  648.                }
  649.                _loc11_ = 0;
  650.                _loc2_ = 0;
  651.                while(_loc2_ < _loc3_)
  652.                {
  653.                   _loc7_ = _loc10_.items[_loc2_].oldValue;
  654.                   while(_loc9_.items[_loc11_] != _loc7_)
  655.                   {
  656.                      _loc11_++;
  657.                   }
  658.                   _loc9_.items.splice(_loc11_,1);
  659.                   _loc2_++;
  660.                }
  661.                if(_loc9_.items.length)
  662.                {
  663.                   currentLength -= _loc9_.items.length;
  664.                   dispatchEvent(_loc9_);
  665.                }
  666.                dispatchEvent(param1);
  667.             }
  668.          }
  669.       }
  670.    }
  671. }
  672.